import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:lib_uikit/lib_uikit.dart';

enum GTResultTypeV3 { success, review, failed,inProgress }

class GTResultV3 extends StatelessWidget {
  final GTResultTypeV3 type;
  final String title;
  final String content;
  final VoidCallback? onResultPressed;

  const GTResultV3({super.key, required this.type, required this.title, required this.content, this.onResultPressed});

  @override
  Widget build(BuildContext context) {
    IconData icon;
    Color iconColor;
    switch (type) {
      case GTResultTypeV3.success:
        icon = GTIconFont.e8a9;
        iconColor = GTColorsV3.funct2.color;
        break;
      case GTResultTypeV3.review:
        icon = GTIconFont.e8aa;
        iconColor = GTColorsV3.color2.color;
        break;
      case GTResultTypeV3.failed:
        icon = GTIconFont.e8a8;
        iconColor = GTColorsV3.funct3.color;
        break;
      case GTResultTypeV3.inProgress:
        icon = GTIconFont.ea4a;
        iconColor = GTColorsV3.color2.color;
        break;
    }
    return GestureDetector(
      onTap: () {
        onResultPressed?.call();
      },
      child:
      Column(
        children: [
          Stack(
            alignment: Alignment.center,
            children: [
              Container(
                width: 40,
                height: 40,
                color: GTColorsV3.icon6.color,
              ),
              Icon(
                icon,
                color: iconColor,
                size: 64,
              ),
            ],
          ),
          SizedBox(
            height: 16,
          ),
          Text(
            title,
            textAlign: TextAlign.center,
            style: gtTextStyleW500(fontSize: 20, color: GTColorsV3.text1.color),
          ),
          SizedBox(
            height: 12,
          ),
          Text(
            content,
            textAlign: TextAlign.center,
            style: gtTextStyleW400(fontSize: 14, color: GTColorsV3.text3.color),
          ),
        ],
      ),
    );
  }
}
